#include "mainwindow.h"
#include <QApplication>

#include "SDL.h"
#include <stdio.h>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    MainWindow w;
    w.show();

    SDL_Init(SDL_INIT_VIDEO);
    SDL_Window* window = SDL_CreateWindowFrom((void*)w.winId());
    SDL_Renderer* render = SDL_CreateRenderer(window, -1, 0);

    int ret = SDL_SetRenderDrawColor(render, 255, 0, 0, 255);
	if (ret < 0) { printf("%s\n", SDL_GetError()); }

    ret = SDL_RenderFillRect(render, NULL);
	if (ret < 0) { printf("%s\n", SDL_GetError()); }

    SDL_RenderPresent(render);

    int rc = a.exec();

    SDL_DestroyWindow(window);
    SDL_DestroyRenderer(render);
    SDL_Quit();

    return rc;
}
